<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link href="../../component/layui/css/layui.css" rel="stylesheet">
    <link href="../../component/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="../../component/ace-min/css/style.css" rel="stylesheet">
    <link href="../../component/highlight/styles/default.css" rel="stylesheet" >
    <link href="../../css/common.css" rel="stylesheet">
    <link href="./style.css" rel="stylesheet">
    <script type="text/javascript" src="../../component/layui/layui.js"></script>
    <script type="text/javascript" src="../../component/ace-min/ace.js"></script>
    <script type="text/javascript" src="../../component/ace-min/ext-language_tools.js"></script>
    <script type="text/javascript" src="../../component/highlight/highlight.pack.js"></script>
    <script type="text/javascript" src="../../js/jquery-2.2.4.min.js"></script>
    <script type="text/javascript" src="../../js/win10.child.js"></script>
    <script type="text/javascript" src="./index.js"></script>
</head>
<body class="gray-bg">
<div id="code" class="wrapper-content">
    <div id="list">
        <div class="code-head">
            <div class="layui-fluid">
                <div class="layui-row">
                    <div class="layui-col-md3 code-head-title">
                        <a href="javascript:location.reload(true);">代码片段</a>
                    </div>
                    <div class="layui-col-md1 layui-col-md-offset8 code-head-operate">
                        <button class="layui-btn layui-btn-warm layui-btn-sm" onclick="Codes._createCode()">发布代码</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="code-content">
            <div class="code-type layui-fluid">
                <form class="layui-form" lay-filter="form">
                    <div class="layui-row">
                        <div class="layui-card" style="box-shadow: 0 0 rgba(0,0,0,.05);">
                            <div class="layui-card-body">
                                <div class="layui-form-item">
                                    <div class="layui-col-sm4">
                                        <label class="layui-form-label">分类</label>
                                        <div class="layui-input-inline">
                                            <select id="category" name="category" lay-filter="category" lay-search=""></select>
                                        </div>
                                    </div>
                                    <div class="layui-col-sm4">
                                        <label class="layui-form-label">语言</label>
                                        <div class="layui-input-inline">
                                            <select id="type" name="type" lay-filter="type" lay-search=""></select>
                                        </div>
                                    </div>
                                    <div class="layui-col-sm4">
                                        <label class="layui-form-label">排序</label>
                                        <div class="layui-input-inline">
                                            <select name="classify">
                                                <option value=""></option>
                                                <option value="1">更新时间</option>
                                                <option value="2">创建时间</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="code-list layui-fluid">
                <div class="code-list-title">
                    <div id="total" class="total"></div>
                </div><hr>
                <div id="code-list-content" class="code-list-content">
                    <div class="code-abstract">没有数据</div>
                </div>
                <div id="pageable"></div>
            </div>
        </div>
    </div>
    <div id="edit">
        <button type="button" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-normal back"
                onclick="Codes._toList()">
            <i class="fa fa-chevron-circle-left" aria-hidden="true"></i> 返回
        </button>
        <form class="layui-form" action="" lay-filter="codeEdit">
            <div class="layui-form-item">
                <label class="layui-form-label">代码概要：</label>
                <div class="layui-input-block">
                    <input type="text" name="codeAbstract" lay-verify="required" autocomplete="off" placeholder="代码概要" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">分类：</label>
                    <div class="layui-input-inline">
                        <select id="codeCategory" name="codeCategory" lay-verify="required" lay-filter="codeCategory" lay-search=""></select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">语言：</label>
                    <div class="layui-input-inline">
                        <select id="codeType" name="codeType" lay-verify="required" lay-filter="codeType" lay-search=""></select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否私有：</label>
                <div class="layui-input-block">
                    <input type="checkbox" name="codePrivate" lay-verify="required" lay-skin="switch" lay-text="是|否">
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">代码片段：</label>
                <div class="layui-input-block">
                    <div id="codeContent" class="codeContent"></div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="button" class="layui-btn" lay-submit lay-filter="codeSubmit">立即提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
<div id="codeView" class="codeView" style="display: none">
    <form class="layui-form" action="" lay-filter="codeView">
        <div class="layui-form-item">
            <label class="layui-form-label">代码概要：</label>
            <div class="layui-input-block">
                <input type="text" name="codeAbstract" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">分类：</label>
            <div class="layui-input-block">
                <input type="text" name="codeCategory" readonly class="layui-input">
            </div>
       </div>
       <div class="layui-form-item">
            <label class="layui-form-label">语言：</label>
            <div class="layui-input-block">
                <input type="text" name="codeType" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">代码片段：</label>
            <div class="layui-input-block">
                <div class="code-highlight">
                    <pre id="codeContentView"></pre>
                </div>
            </div>
        </div>
    </form>
</div>
</html>
